<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> 
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    
	
	<title>_调拨状态查询</title>
	<script type="text/javascript">
	
        $(function() {
		    $("#queryForm").validate(); 
		    $("#inputForm").validate(); 
			$("#_fromDate").datepicker({ format : 'yyyy-mm-dd' });
			$("#_toDate").datepicker({ format : 'yyyy-mm-dd' });
       });
       
    </script>
</head>

<body>
	
	<div style="height: 10px;"></div>
	
	<div class="row">
		<div class="span12" style="margin-left: 20px;">
			<form class="form-search" id="queryForm" action="${ctx}/allotMsg" method="post">
			
			    <label style="margin-left:10px;">调拨单号：</label> 
				<input  name="_allotCode"  id="_allotCode" value="${param._allotCode}"  class="input-medium" />
			
				<label style="margin-left:10px;">调入仓库：</label> 
				<select  name="_instorageCode"  id="_instorageCode" value="${param._instorageCode}"  class="input-medium">
					<option value=""></option>
					<c:forEach items="${areagroupList}" var="areagroup">
						<option value="${areagroup.groupCode}"
						<c:if test="${param._instorageCode eq areagroup.groupCode}">selected=selected</c:if>
						>${areagroup.groupName}</option>
					</c:forEach>
				</select>
				
				<label style="margin-left:10px;">调拨单状态：</label> 
				<select  name="_status"  id="_status" value="${param._status}"  class="input-medium">
					<option value="" <c:if test="${param._status eq ''}">selected=selected</c:if> ></option>
				    <option value="1" <c:if test="${param._status eq '1'}">selected=selected</c:if> >发起申请</option>
				    <option value="2" <c:if test="${param._status eq '2'}">selected=selected</c:if> >审核通过</option>
				    <option value="3" <c:if test="${param._status eq '3'}">selected=selected</c:if> >审核驳回</option>
				    <option value="4" <c:if test="${param._status eq '4'}">selected=selected</c:if> >创建拣货任务</option>
				    <option value="5" <c:if test="${param._status eq '5'}">selected=selected</c:if> >拣货任务指派</option>
				    <option value="6" <c:if test="${param._status eq '6'}">selected=selected</c:if> >拣货任务完成</option>
				    <option value="7" <c:if test="${param._status eq '7'}">selected=selected</c:if> >打包</option>
				    <option value="8" <c:if test="${param._status eq '8'}">selected=selected</c:if> >出库</option>
				    <option value="9" <c:if test="${param._status eq '9'}">selected=selected</c:if> >入库</option>
				    <option value="10" <c:if test="${param._status eq '10'}">selected=selected</c:if> >调拨完成 </option>
				</select>
				
				<label>&nbsp;&nbsp;&nbsp;申请日期&nbsp;&nbsp;&nbsp;从：</label> 
			 	<input type="text" name="_fromDate" id="_fromDate"  class="input-medium" value="${_fromDate}" style="margin-left: -10px;"> 
			 	<label>至：</label> 
			 	<input type="text" name="_toDate" id="_toDate" class="input-medium" value="${_toDate}" style="margin-left: -10px;"> 
			 	
			    <button type="submit" class="btn" style="margin-left: 10px;">搜索</button>
		    </form>
	    </div>
	</div>
	
	
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead><tr>
	        <th style="width: 100px;">调拨单号</th>
		    <th style="width: 100px;">调出仓库</th>
		    <th style="width: 100px;">调入仓库</th>
		     <th style="width:100px;">当前状态</th>
		    <th style="width: 150px;">申请时间</th>
		    <th style="width: 100px;">申请人</th>
			<th style="width: 150px;">管理</th>
		</tr></thead>
		<tbody>
		<c:if test="${page ne null }">
		<c:forEach items="${page.content}" var="allot">
			<tr>
			    <td>${allot.allotCode}</td>
			    <td>${allot.outstorage.groupName}</td>
			    <td>${allot.instotrage.groupName}</td>
			    <td>
			      <c:if test="${allot.status eq '1' }">发起申请</c:if>
			      <c:if test="${allot.status eq '2' }">审核通过</c:if>
			      <c:if test="${allot.status eq '3' }">审核驳回</c:if>
			      <c:if test="${allot.status eq '4' }">创建拣货任务</c:if>
			      <c:if test="${allot.status eq '5' }">拣货任务指派</c:if>
			      <c:if test="${allot.status eq '6' }">拣货任务完成</c:if>
			      <c:if test="${allot.status eq '7' }">打包</c:if>
			      <c:if test="${allot.status eq '8' }">出库</c:if>
			      <c:if test="${allot.status eq '9' }">入库</c:if>
			      <c:if test="${allot.status eq '10' }">调拨完成</c:if>
			    </td>
			    <td>${fn:substring(allot.requestTime,0,19)}</td>
			    <td>${allot.requester.realname}</td>
			    <td>
			       <a href="${ctx}/allotMsg/detail/${allot.id}" class="btn btn-info">详情</a>
			    </td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	</c:if>
	
	<c:if test="${page ne null }">
	<tags:pagination page="${page}" paginationSize="5"/>
	</c:if>

	 
	
</body>
</html>
